package com.sc.nft.entity.vo;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class PerformanceVO {
    @ApiModelProperty("本周团队业绩")
    private String teamPerformanceThisWeek;
    @ApiModelProperty("本月团队业绩")
    private String teamPerformanceThisMonth;
    @ApiModelProperty("团队持仓成本")
    private String teamCost;
    @ApiModelProperty("团队有效用户")
    private Integer validatedUser;
    @ApiModelProperty("团队社区网点")
    private Integer teamCommunityNetwork;
    @ApiModelProperty("团队城市服务中心")
    private Integer teamCityServiceCenter;

    public void setTeamPerformanceThisWeek(BigDecimal teamPerformanceThisWeek) {
        if (ObjectUtil.isEmpty(teamPerformanceThisWeek)) {
            teamPerformanceThisWeek=BigDecimal.ZERO;
        }
        this.teamPerformanceThisWeek = StrUtil.format("{} {}","¥",teamPerformanceThisWeek.setScale(2,BigDecimal.ROUND_DOWN).toPlainString());
    }

    public void setTeamPerformanceThisMonth(BigDecimal teamPerformanceThisMonth) {
        if (ObjectUtil.isEmpty(teamPerformanceThisMonth)) {
            teamPerformanceThisMonth=BigDecimal.ZERO;
        }
        this.teamPerformanceThisMonth = StrUtil.format("{} {}","¥",teamPerformanceThisMonth.setScale(2,BigDecimal.ROUND_DOWN).toPlainString());
    }

    public void setTeamCost(BigDecimal teamCost) {
        if (ObjectUtil.isEmpty(teamCost)) {
            teamCost=BigDecimal.ZERO;
        }
        this.teamCost =StrUtil.format("{} {}","¥", teamCost.setScale(2,BigDecimal.ROUND_DOWN).toPlainString());
    }

}
